<div id="sanpham_right">
           	    <div id="title_right">
            		<p id="title_right_left"></p>
            		<div id="title_right_center">
            		  <p class="chu_title">DANH SÁCH MẶT HÀNG </p>
            		</div>
           			<p id="title_right_right"></p>
             	</div>
                <div id="noidung_right">
<?php if($data){?>
			<table width = "700" cellpadding = "5" cellspacing = "2" border = "1" align = "center" bgcolor = "#D4D0C8">

			<tr>
				<td width = "150" valign = "top"> <div align = "center"> <b> Hình Ảnh </b> </div> </td> 
				<td width = "150" valign = "top"> <div align = "center"> <b> Loại Hàng</b> </div> </td>
				<td width = "100" valign = "top"> <div align = "center"> <b> Tên Mặt Hàng </b> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <b> Đơn Vị Tính</b> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <b> Số Lượng</b> </div> </td>
				<td width = "100" valign = "top"> <div align = "center"> <b> Đơn Giá </b> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <b> Mô Tả</b> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <b> Trạng thái </b> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <img src="public/images/b_edit.png"/> Sửa</div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <img src="public/images/b_drop.png"/> Xóa </div> </td>
			</tr>
			<tr> 
<?php		 if (is_array($data['list'])){
			 foreach ($data['list'] as $key => $value) { ?>
				<td width = "150" valign = "top"> <div align = "center"><img src = "public/upload/<?php echo $value['HinhAnh'];?>" width = "50" height="50"/> </div> </td>
				<td width = "150" valign = "top"> <div align = "center">
				<?php
				if(is_array($data['listlh'])){
					foreach ($data['listlh'] as $item){
						if($item['MaLH']==$value['MaLH']){ 
							echo $item['TenLH'];
						}
					}
				}
				?>
		</div> </td>
				<td width = "100" valign = "top"> <div align = "left"><?php echo $value['TenMH'];?> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"><?php echo $value['DVT'];?> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"><?php echo $value['SoLuong'];?> </div> </td>
				<td width = "100" valign = "top"> <div align = "center"><?php echo $value['Gia'];?> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"><?php echo 'Đã lưu'?> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"><?php if($value['AnHien'] == 1){ echo 'Hiện';}else{ echo 'Ẩn';}?> </div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <a href = "admin.php?mod=updatemathang&ma=<?php echo $value['MaMH'];?>"> Sửa </a></div> </td>
				<td width = "50" valign = "top"> <div align = "center"> <a href = "admin.php?mod=delmathang&ma=<?php echo $value['MaMH'];?>">  Xóa</a> </div> </td>
			</tr>
			<?php
				}	}	
			?>
		</table>
<?php 
	
}
	
?>
<?php
//Xuat phan trang 
	 echo "<p align='center'>";
	 echo "<br>";
	 echo "<br>";
	 echo "<br>";
	 echo $pagelist;
	 echo "</p>";
?>
</div>
</div>